const User = require('./User');
const City = require('./City');
const Weather = require('./Weather');
const UserCity = require('./UserCity');
const WeatherCache = require('./WeatherCache');

// 设置模型之间的关联
User.associate({ City, UserCity });
City.associate({ User, Weather, UserCity, WeatherCache });
Weather.associate({ City });
// WeatherCache.associate({ City }); // Removed as WeatherCache no longer directly associates with City model

// 确保 UserCity 也能识别它的外键
UserCity.belongsTo(User, { foreignKey: 'user_id' });
UserCity.belongsTo(City, { foreignKey: 'city_id' });

module.exports = {
  User,
  City,
  Weather,
  UserCity,
  WeatherCache
}; 